Pod::Spec.new do |s|
  s.name             = 'WGBToolKit'
  s.version          = '0.1.4'
  s.summary          = 'WGBToolKit就是一个工具类库,封装了一些常用的工具'

  s.description      = <<-DESC
WGBToolKit就是一个工具类库,封装了一些常用的工具,为了快速开发,用自己称手的工具
                       DESC

  s.homepage         = 'https://gitee.com/wangguibin/wgbtool-kit'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'CoderWGB' => '864562082@qq.com' }
  s.source           = { :git => 'https://gitee.com/wangguibin/wgbtool-kit', :tag => s.version.to_s }

  s.ios.deployment_target = '10.0'
  s.requires_arc = true

  # s.prefix_header_file = 'WGBToolKit/WGBToolKit.h' #它会把`WGBToolKit.h`头文件的内容引入到pch里
  # s.public_header_files = 'WGBToolKit/WGBToolKit.h'
  s.source_files = 'WGBToolKit/WGBToolKit.h' #配置个头文件 统一入口引入 
  s.frameworks = 'UIKit', 'Foundation' #基础系统依赖库
  s.default_subspecs = ['Foundation', 'UIKit']


  s.subspec 'DebugTool' do |ss|
    ss.source_files = 'WGBToolKit/DebugTool/WGBDebugTool.h'

    #InjectionIIIHelper 热重载插件  
    ss.subspec 'InjectionIIIHelper' do |sss|
      sss.source_files = 'WGBToolKit/DebugTool/InjectionIIIHelper/*.{h,m}'
    end
  end

  #UIKit相关工具类或组件
  s.subspec 'UIKit' do |ss|
    ss.source_files = 'WGBToolKit/UIKit/*' 
    uikits = Array['UIButton','UIColor',] #目录结构组成比较简单的且有规律的饭数组遍历了 这样简单些
    for uikit in uikits
      ss.subspec uikit do |sss|
        sss.source_files = 'WGBToolKit/UIKit/' + uikit + '/*.{h,m}'
      end
    end
     #UI Components
    ss.subspec 'Components' do |sss|
      components = Array['JHSoundWaveView','YBAttributeTextTapAction','TPGradientButton','WGBAlertView'] 
      for component in components 
        sss.subspec component do |comp|
         comp.source_files = 'WGBToolKit/UIKit/Components/'+ component +'/*.{h,m}'
        end
      end
    end
    #收集一些Layout代码
    ss.subspec 'Layout' do |sss|
      layouts = Array['DYHorizontalFlowLayout'] 
      for layout in layouts 
        sss.subspec layout do |lay|
         lay.source_files = 'WGBToolKit/UIKit/Layout/'+ layout +'/*.{h,m}'
        end
      end
    end
  end

  #Foundation相关工具或组件
  s.subspec 'Foundation' do |ss|
      ss.source_files = 'WGBToolKit/Foundation/*' 
      foundations = Array['NSArray','NSDictionary','NSObject'] #有新的模块可以在数组里追加 注意目录摆放就是了
      for  subModuleName in foundations
        ss.subspec subModuleName  do |sss|
          sss.source_files = 'WGBToolKit/Foundation/' + subModuleName + '/*.{h,m}'
        end
      end
  end

  # s.default_subspecs = 'Core'
  # s.default_subspecs = ['Core', 'UI'] #可以默认多个 用数组
  # s.subspec 'pb' do |pbspec|
  #       pbspec.source_files = 'SDK/Services/pb/*.{m,mm,h}'
  #       pbspec.requires_arc = false #局部mrc
  # end
  # s.source_files = 'WGBToolKit/Classes/**/*' #挑选作为库文件
  # s.resource_bundles = {   # bundle资源 会生成一个WGBToolKit.bundle 
  #   'WGBToolKit' => ['WGBToolKit/Assets/*.png']
  # }
  #s.resources = 'SDK/xxx/Service/**/*.{xib}' #资源文件会放到mainBundle里
  #  ss.vendored_libraries = 'HMApplePaySDK/libs/libUPAPayPlugin.a' #静态库
  # ss.public_header_files = 'HMApplePaySDK/inc/*.h' #静态库的头文件
  #s.vendored_frameworks = 'SDK/Tencent/GMESDK.framework' # 依赖的私有framework
  # s.public_header_files = 'Pod/Classes/**/*.h' 
  # s.private_header_files = 'xxx/xxx.h' #貌似没啥用 直接source_files就完事了
  # s.dependency 'FMDB', '2.7.5'
  # s.dependency 'AFNetworking', '~> 2.3' #依赖只能依赖同源的库 如果有不同源的库 fork到私有源管理即可
  #s.dependency 'AFNetworking', '~> 3.0', :source => 'https://github.com/AFNetworking/AFNetworking.git' #GPT说可以指定源 实际上.spec中不能 Podfile中可以

end
